# 决战紫禁之巅有两个人物，西门吹雪以及叶孤城
# 属性：
# name 玩家的名字
# blood 玩家血量
#
# 方法：
# tong() 捅对方一刀,对方掉血10滴
# kanren() 砍对方一刀，对方掉血15滴
# chiyao() 吃一颗药，补血10滴
# __str__ 打印玩家状态。
class Hero:
    def __init__(self,name,blood):
        self.name=name
        self.blood=blood
        pass
    def tong(self,diren):
        "捅对方一刀,对方掉血10滴"
        diren.blood-=10   #让对方血量-10
        print("【{}】捅了【{}】一刀".format(self.name,diren.name))
        pass
    def kanren(self,diren):
        "kanren() 砍对方一刀，对方掉血15滴"
        diren.blood -= 15  # 让对方血量-10
        print("【{}】砍了【{}】一刀".format(self.name, diren.name))
        pass
    def chiyao(self):
        "chiyao() 吃一颗药，补血10滴"
        self.blood+=15
        print("【{}】吃了一个药，补充血量10滴".format(self.name))
        pass
    def __str__(self):
        return "【{}】的当前血量值为【{}】".format(self.name,self.blood)
    pass
xmcx=Hero("西门吹雪",120)
ygc=Hero("叶孤城",130)
print(xmcx)
print(ygc)
while True:
    if xmcx.blood<=0 or ygc.blood<=0:
        print("游戏结束")
        break
        pass
    print("===========================")
    xmcx.tong(ygc)
    print(xmcx)
    print(ygc)
    print("===========================")
    ygc.kanren(xmcx)
    print(xmcx)
    print(ygc)
    print("===========================")
    xmcx.chiyao()
    print(xmcx)
    print(ygc)
    print("===========================")

